//
//  DFCommand.m
//  dfCommandBuilder
//
//  Created by Tom Booth on 31/05/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "DFCommand.h"


@implementation DFCommand

@synthesize returnsRows;
@synthesize createsRows;
@synthesize name;
@synthesize description;

- (id) initWithName:(NSString*)name {
	self.name = name;
	parameters = [[NSMutableArray alloc] init];
	returnParameters = [[NSMutableArray alloc] init];
	rowParameters = [[NSMutableArray alloc] init];
	
	return self;
}


- (void) addParameter:(DFParameter*)parameter {
	[parameters addObject:parameter];
}

- (void) addReturnParameter:(DFParameter*)parameter {
	[returnParameters addObject:parameter];
}

- (void) addRowParameter:(DFParameter*)parameter {
	[rowParameters addObject:parameter];
}

- (NSArray*) getParameters {
	return parameters;
}

- (NSArray*) getReturnParameters {
	return returnParameters;
}

- (NSArray*) getRowParameters {
	return rowParameters;
}

- (BOOL) isEqual:(id) item {
	return ([[item name] compare:[self name]] == NSOrderedSame );
}

@end
